﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Cinema_Ticketing_System.Models
{
    public class Get_User_Information
    {
        CinemaDBEntities2 cdb = new CinemaDBEntities2();
        /// <summary>
        /// 跟据用户输入的账号密码查询返回用户 未查询到则返回Null
        /// </summary>
        /// <param name="loginId">账号</param>
        /// <param name="loginPwd">密码</param>
        /// <returns></returns>
        public user_table GetUserInformation(string loginId,string loginPwd)
        {
            //获取传入信息对应的用用户信息
            user_table userinformation = cdb.user_table.SingleOrDefault(x=>x.username== loginId||x.userphone==loginId&& x.userpassword==loginPwd);
            return userinformation;
        }
    }
}